import request from "@/request/api";
/* 位置管理 */

//查询位置列表
export function getlocationList(data) {
  return request({
    url: "/eam-service-device/device/location/queryList",
    method: "get",
    params: data,
  });
}
//查询位置管理树状结构
export function locationTree(data) {
  return request({
    url: "/eam-service-device/device/location/getTree",
    method: "get",
    params: data,
  });
}
//查询设备列表数据
export function getEquipmentById(data) {
  return request({
    url: "/eam-service-device/device/location/getEquipmentById",
    method: "get",
    params: data,
  });
}
//查询单个位置信息
export function getDetailsApi(id="") {
  return request({
    url: "/eam-service-device/device/location/getById",
    method: "get",
    params: {id},
  });
}
//新增位置
export function insertApi(data) {
  return request({
    url: "/eam-service-device/device/location/insert",
    method: "post",
    data: data,
  });
}
//修改位置
export function updateApi(data) {
  return request({
    url: "/eam-service-device/device/location/update",
    method: "put",
    data: data,
  });
}
//删除位置
export function deleteApi(id="") {
  return request({
    url: "/eam-service-device/device/location/delete",
    method: "get",
    params: {id},
  });
}
//移动节点
export function moveNode(data) {
  return request({
    url: "/eam-service-device/device/location/moveNode",
    method: "get",
    params: data,
  });
}
//获取节点的所有父级节点
export function getParentNode(orgId="") {
  return request({
    url: "/eam-service-device/device/location/getParentIdByOrgId",
    method: "get",
    params: {orgId},
  });
}


